package la.iok.hzsvn.lewin.movie.cloud.mapper;

import la.iok.hzsvn.lewin.movie.cloud.entity.UserRole;
import la.iok.hzsvn.lewin.mybatis.mapper.BaseMapper;
import la.iok.hzsvn.share.annotations.NotNull;
import la.iok.hzsvn.share.annotations.Nullable;

import java.util.Collection;
import java.util.List;

public interface UserRoleMapper extends BaseMapper<UserRole> {
    @Nullable
    UserRole select(@NotNull Long userId, @NotNull Long roleId, @NotNull Long orgUnitId);

    int count(Collection<Long> orgUnitIds);

    List<UserRole> selectRoles(Long orgUnitId, Long roleId);

    int increaseScore(Long userId,Long orgUnitId,Long score);

    int reduceScore(Long userId,Long orgUnitId,Long score);

    List<UserRole> selectScore(Long userId, Long orgUnitId);


}
